home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ASME's Mechanical Engine…ing Toolkit 1997 December
/
ASME's Mechanical Engineering Toolkit 1997 December.iso
/
elec_eng
/
eepddsk2.lzh
/
NETWORKS.BAS
< prev
next >
Wrap
BASIC Source File
|
1987-02-08
|
5KB
|
150 lines
1 REM "NETWORKS" FROM RF DESIGN, APRIL 85, BY ALAN J. LAPENN. :PRINT
2 PRINT "THREE ELEMENT MATCHING NETWORKS, AS FOLLOWS:" :PRINT
3 PRINT "TYPE TO MATCH ELEMENT 1 ELEMENT 2 ELEMENT 3" :PRINT
4 PRINT "1-LOWPASS RS<=RL SHUNT C SERIES L SHUNT C"
5 PRINT "2-HIGHPASS RS<=RL SHUNT L SERIES C SHUNT L"
6 PRINT "3-LOWPASS RS<RL SHUNT L SERIES L SHUNT C"
7 PRINT "4-HIGHPASS RS<RL SHUNT C SERIES C SHUNT L"
8 PRINT "5-LOWPASS RS<=RL SERIES L SHUNT C SERIES L"
9 PRINT "6-HIGHPASS RS<=RL SERIES C SHUNT L SERIES C"
10 PRINT "7-LOWPASS RS<RL SERIES L SHUNT C SERIES C"
11 PRINT "8-HIGHPASS RS<RL SERIES C SHUNT L SERIES L"
12 PRINT "9-LOWPASS RS<RL SERIES C SERIES L SHUNT C"
13 PRINT "10-HIGHPASS RS<RL SERIES L SERIES C SHUNT L"
14 PRINT "11-LOWPASS RS<RL SERIES L SHUNT C SHUNT L"
15 PRINT "12-HIGHPASS RS<RL SERIES C SHUNT L SHUNT C"
16 PRINT "13-LOWPASS RS<RL SERIES L SHUNT C NONE"
17 PRINT "14-HIGHPASS RS<RL SERIES C SHUNT L NONE"
18 PRINT
19 REM MAIN PROGRAM
20 PRINT "ENTER SOURCE RESISTANCE IN OHMS:"
30 INPUT RS
40 PRINT "ENTER LOAD RESISTANCE IN OHMS:"
50 INPUT RL
52 IF RS <= RL THEN 60
54 PRINT "RS MUST BE LESS THAN OR EQUAL TO RL"
56 GOTO 20
60 QM = SQR (RL/RS-1)
70 PRINT "ENTER FREQUENCY IN HERTZ FOR RESULTS IN HENRIES AND FARADS"
75 PRINT"OR ENTER 0 FOR RESULTS IN REACTANCE VALUES."
80 INPUT FO
90 PRINT "ENTER DESIRED NETWORK (1-14):"
100 INPUT NET
105 PRINT
110 PRINT "QMIN="; QM
112 PRINT
115 Q = QM
120 IF NET > 12 THEN 150
130 PRINT "ENTER DESIRED VALUE OF Q (Q >= QMIN):"
140 INPUT Q
142 IF Q >= QM THEN 150
144 PRINT "Q MUST BE GREATER THAN OR EQUAL TO "; QM
146 GOTO 130
150 ON NET GOSUB 400,400,500,500,600,600,700,700,800,800,900,900,1000,1000
160 IF FO = 0 THEN 300
170 ON SGN (X1) + 1 GOTO 190,200
180 F1 = (1/(6.28*FO*X1))*-1
190 GOTO 210
200 F1 = X1/(6.28*FO)
210 ON SGN(X2)+ 1 GOTO 230,240
220 F2 = (1/(6.28*FO*X2))*-1
230 GOTO 250
240 F2 = X2/(6.28*FO)
250 IF NET > 12 THEN 300
260 ON SGN (X3) + 1 GOTO 280,290
270 F3 = (1/(6.28*FO*X3))*-1
280 GOTO 300
290 F3 = X3/(6.28*FO)
300 GOSUB 1200
305 PRINT
310 PRINT "ENTER 1 TO RUN PROGRAM AGAIN 0 TO END:"
320 INPUT D
330 IF D = 1 THEN 3
340 END
400 REM NET1 RS<= RL
410 X1 = RS*(SQR((RL/RS)/(Q^2 + 1-(RL/RS))))* -1
420 X2 = (Q*RL-(RS*RL/X1))/(Q^2 + 1)
430 X3 = (RL/Q)*-1
440 IF NET = 1 THEN 460
450 GOSUB 1100
460 RETURN
500 REM NET3 RS<RL
510 X1 = RS/(SQR((RS*(Q^2 + 1))/RL-1))
520 X2 = ((RL*Q)/(Q^2 + 1)) * (1-(RS/(Q*X1)))
530 X3 = (RL/Q)*-1
540 IF NET = 3 THEN 560
550 GOSUB 1100
560 RETURN
600 REM NET5 RS<=RL
610 X1 = RS*Q
620 X2 = (RS* (1 + Q^2) * -1)/(Q + SQR((RS* (1 +Q^2))/RL-1))
630 X3 = RL*SQR((RS* (1 + Q^2))/RL-1)
640 IF NET = 5 THEN 660
650 GOSUB 1100
660 RETURN
700 REM NET7 RS<RL
710 X1 = RS*Q
720 X2 = (RS* (1 + Q^2) *-1)/(Q-SQR((RS*(1 + Q^2))/RL-1))
730 X3 = RL*SQR((RS* (1 + Q^2))/RL-1) *-1
740 IF NET = 7 THEN 760
750 GOSUB 1100
760 RETURN
800 REM NET9 RS<RL
810 X1 = -SQR(RS*RL-RS^2-Q*RS)
820 X2 = Q*RS
830 X3 = (RS*RL*-1)/(X1 + X2)
840 IF NET = 9 THEN 860
850 GOSUB 1100
860 RETURN
900 REM NET11 RS<RL
910 X1 = RS*SQR(RL/RS-1)
920 X2 = RL/Q*-1
930 X3 = X2/(X1/(Q*RS)-1)
940 IF NET = 11 THEN 960
950 GOSUB 1100
960 RETURN
1000 REM NET13
1010 X1 = SQR(RS*RL-RS^2)
1020 X2 = (RS*RL*-1)/X1
1030 IF NET = 13 THEN 1050
1040 GOSUB 1100
1050 RETURN
1100 REM INVERSE SUBROUTINE
1110 X1 = X1*-1
1120 X2 = X2*-1
1130 IF NET = 14 THEN 1150
1140 X3 = X3*-1
1150 RETURN
1200 REM PRINT ROUTINE
1204 PRINT
1206 PRINT
1210 PRINT "SOURCE RESISTANCE = "; RS; "OHMS"
1220 PRINT "LOAD RESISTANCE = "; RL; "OHMS"
1230 PRINT "QMIN = ";QM
1240 IF QM = Q THEN 1270
1250 PRINT "Q = ";Q
1270 PRINT "NETWORK NUMBER";NET
1280 IF FO <> 0 THEN 1340
1300 PRINT "X1 = "; X1; "OHMS"
1310 PRINT "X2 = "; X2; "OHMS"
1315 IF NET > 12 THEN 1330
1320 PRINT "X3 = "; X3; "OHMS"
1324 PRINT
1326 PRINT "POSITIVE VALUES FOR INDUCTIVE REACTANCE AND NEGATIVE VALUES FOR CAPACITIVE REACTANCE."
1330 RETURN
1340 PRINT "FREQUENCY = "; FO; "HERTZ"
1345 ON SGN (X1) + 1 GOTO 1360,1370
1350 PRINT "C1 = "; F1; "FARADS"
1360 GOTO 1380
1370 PRINT "L1 = "; F1; "HENRIES"
1380 ON SGN (X2) + 1 GOTO 1400,1410
1390 PRINT "C2 = "; F2; "FARADS"
1400 GOTO 1420
1410 PRINT "L2 = "; F2; "HENRIES"
1420 IF NET > 12 THEN 1470
1430 ON SGN (X3) + 1 GOTO 1450,1460
1440 PRINT "C3 = "; F3; "FARADS"
1450 GOTO 1470
1460 PRINT "L3 = "; F3; "HENRIES"
1470 RETURN